Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Castle main limitations.txt
blob9251ed896d3780478d78237d0b298b54c367581c
1 \r
2 ** Most of the issues below will be fixed by Castle.DynamicProxy 2.0\r
3 \r
4 \r
5 Interface proxy and properties only available on the implementation type\r
6 ========================================================================\r
7 \r
8 Reported by: hammett (April 12th, 2006)\r
9 \r
10 This is easy to reproduce. \r
12 public interface IMyService\r
13 {\r
14   void DoSomething();\r
15 }\r
17 [Transactional]\r
18 public class MyServiceImplementation : IMyService\r
19 {\r
20   public int SomeParam\r
21   { get and set implementation here }\r
23   [Transaction]\r
24   public void DoSomething()\r
25   {\r
26   }\r
27 }\r
29 And on the configuration\r
31 <component \r
32   id="my.service" \r
33   service="IMyService, MyAssembly" \r
34   type="MyServiceImplementation, MyAssembly">\r
36   <parameters>\r
37     <SomeParam>100</SomeParam>\r
38   </parameters>\r
40 </component>\r
42 The Transactional/Transaction will force the container to create a proxy for the component. As the component was registered with a service contract (interface) dynamic proxy will generate an interface proxy. The container will try to set the propertu SomeParam on the proxy and boom, you have a nice exception.\r
44 Possible solution: New version of DynamicProxy can make all proxies implement an interface ITargetAccessor. The container can check for this interface before trying to set anything on the component and voila!\r
47 Transaction management: cannot suspend current transaction\r
48 ==========================================================\r
50 Reported by: hammett (April 12th, 2006)\r
52 The transaction management that Castle is able to do is very limited compared to what DTC can offer (through COM+). In order to achieve the same level of features we would need to decide which path to take\r
54 - Integrate with DTC\r
56   Pros: fine-grained control of integration, support to 2PC, a possible lightweight way of handling transactions without involving COM+\r
57   Cons: Few or non-existent documentation. MS really don't want developers 'messing' with their DTC otherwise they would have published its API documentation. It's Windows only.\r
59 - Figure out a way of handling suspension or simulate a physical transaction suspension\r
61   Pros: simpler solution\r
62   Cons: might require lots of hacks\r
64 - Integrate with COM+\r
66   Pros: standard MS-way of dealing with transaction in an 'enterprise' fashion\r
67   Cons: heavyweight, make deployments harder and more subject to 'strange' errors\r
71 Windsor component proxies, when accessed through remote, methods are not intercepted\r
72 ====================================================================================\r
74 Reported by: hammett (April 12th, 2006)\r
76 Windsor proxy factory choses between two approaches to generate proxies:\r
78 - If the type extends MarshalByRef it uses the standard .net infrastructure to construct a proxy\r
79 - If the type does not extends MarshalByRef it uses DynamicProxy\r
81 However there's an issue with .net proxies, when used in a remote context the calls are not intercepted. A possible solution would be to register a custom sink on the transportation channel being used. There's no easy way of doing this non-intrusively, so it would be up to the user to add a custom sink through the configuration file that configures the remoting infrastructure. The sink, though, need to be coded.\r
85 Dynamic proxies cannot be used in a remoting context\r
86 ====================================================\r
88 Reported by: hammett (April 12th, 2006)\r
90 Is there a way to transient types cross boundaries?\r